<?php


class indexAction extends T {



	function index() {
	
		$this->php->loaddb()->loadview()->helper("function")->init();
		
		$html = $this->php->view->render("index/index.php");
		
		echo jhtml($html);
		
		//$job_m = $this->php->M("job");
		//$job_m->index();
	
	}
	
	function job() {
	
		$this->php->view()->init();
		
		$this->php->view->assign("a","abc");
		$this->php->view->display("index/job.php");
	
	}
	
	function zhaopin () {
		$id = (int)$_GET["id"];
		if($id == 0) exit();
		
		
		$this->php->loaddb()->loadview()->helper("function")->init();
		
		$vo = $this->db->settable("job_zhaopin")->where("id=".$id)->find();
		if(!$vo) exit();
		
		$userid = $vo["userid"];
		$user = $this->db->settable("www_qiye")->where("userid=".$userid)->find();
		
		$this->view->assign("vo",$vo);
		$this->view->assign("user",$user);
		
		//$this->php->view->display("index/zhaopin.php");
		
		
		//-----------------------------
		$this->db->settable("www_tree")->init();
		$list = $this->php->db->select();
		foreach($list as $key) {
			$vokey[$key["id"]] = $key["title"];
		}
		$this->view->assign("vokey",$vokey);
		//-----------------------------
		
		
		
		
		
		
		
		//$this->view->assign("conf",$this->php->config);
		$html = $this->view->render("index/zhaopin.php"); 
		echo jhtml($html);
	
	}
	
	function jianli() {
	
		$this->php->loaddb()->loadview()->helper("function")->init();
	
		$id=(int)$_GET["id"];
		if($id==0) exit();
		
		
		$vo = $this->db->settable("job_jianli")->where("id =".$id)->find();
		if(!$vo) exit();
		
		$this->db->settable("www_tree")->init();
		$diqu = $this->db->where("pid=6")->select();
		$jingyan = $this->db->where("pid=7")->select();
		$xinzi = $this->db->where("pid=8")->select();
		$xueli = $this->db->where("pid=26")->select();
		
		
		$this->view->assign("diqu",$diqu);
		$this->view->assign("jingyan",$jingyan);
		$this->view->assign("xinzi",$xinzi);
		$this->view->assign("xueli",$xueli);
		$this->view->assign("vo",$vo);
		$html = $this->php->view->render("index/jianli.php");
		echo jhtml($html);
	
	}
	
	function qiye() {
	
		$id = (int)$_GET["id"];
		
		
		$this->php->loaddb()->loadview()->helper("function")->init();
		
		$vo = $this->db->settable("www_qiye")->where("userid=".$id)->find();
		if(!$vo) exit();
		
		$zhaopin_list = $this->db->settable("job_zhaopin")->where("userid = ".$id)->select();
		
		$this->php->view->assign("vo",$vo);
		$this->php->view->assign("zhaopin_list",$zhaopin_list);
		
		
		$html = $this->php->view->render("index/qiye.php");
		echo jhtml($html);
		
		
		
	}
	
	function __destruct () {
	
		
		if(empty($this->php->config["misc"]["debug"])) exit();
		
		$str = $this->php->db->getMsg();
		echo "<hr />";
		echo $str;
	}

}